package com.xbongbong.paas.service.stage.config;

import com.xbongbong.paas.service.stage.StageLogHandle;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Map;
import java.util.stream.Collectors;

/**
 * stageLog策略 配置
 * @author 李少杰
 * @version v1.0.0
 * @date 2021/11/23 14:03
 */
@Configuration
public class StageLogHandleConfig {

    @Autowired
    private Map<String, StageLogHandle> stageLogHandleMap;

    @Bean("stageLogHandleMap")
    public Map<Integer, StageLogHandle> initstageLogHandleMap() {
        return stageLogHandleMap.values().stream().collect(Collectors.toMap(StageLogHandle::businessType, t -> t));
    }
}
